﻿using System;
using System.Windows.Forms;


namespace NetMon
{
    public partial class InterfaceSelect : Form
    {
        public InterfaceSelect(string[] deviceNames)
        {
            InitializeComponent();
            this.InterfaceList.Items.AddRange(deviceNames);
        }

        private void InterfaceList_SelectedIndexChanged(object sender, EventArgs e)
        {
            btnOK.Enabled = (InterfaceList.SelectedIndex >= 0);
        }

        private void InterfaceList_DoubleClick(object sender, EventArgs e)
        {
            if (InterfaceList.SelectedIndex >= 0)
            {
                DialogResult = DialogResult.OK;
                Hide();
            }
        }
    }
}
